import axios from 'axios'
const service = axios.create({
  // baseURL:"http://127.0.0.1:8089",
  baseURL: "http://123.56.23.31:8989/app/",
  // baseURL: "",
  timeout: 5000,
  withCredentials: true,
  // credentials:'include'
})
// axios.defaults.headers.common['token'] = window.sessionStorage.getItem('token');
service.interceptors.request.use(config => {
  // console.log(config);
  // 需要授权的 API ，必须在请求头中使用 `Authorization` 字段提供 `token` 令牌
  config.headers.token = window.sessionStorage.getItem('token')
  // document.cookie = config.headers.Set-Cookie
  return config
})

service.interceptors.response.use(config => {
  // console.log(config);
  return config
})
export default service